package com.mk.common.office;

import java.io.File;

/**
 * @Author: yq
 * @Description:
 * @Date: Created in 4:18 PM 3/19/18
 */
public class Test {

    public static void main(String[] args) {
        office2pdf2html();
//        office2html();
    }

    public static void office2pdf2html(){
        String sourceFile = "D:\\定位.doc";
        String destFile = "D:\\53\\12.pdf";
        String htmlFile = "D:\\53\\html\\12.html";
        //office 文件转pdf
        int result = Office2PDFUtil.office2PDF(sourceFile,destFile,"D\\:\\sofy\\OpenOffice4\\");
        if(result == 0){
            System.out.println("office转pdf成功");
            //pdf转html
            if(Pdf2htmlEXUtil.pdf2html(destFile,htmlFile)){
                System.out.println("pdf转html成功");
            }else
                System.out.println("pdf转html失败");
        }else if(result == -1){
            System.out.println("找不到源文件");
        }else
            System.out.println("office转pdf失败");
    }

    public static void office2html(){
        System.out.println(Doc2HtmlUtil.office2HtmlString(new File("F:/office/EXCEL实例文件.xlsx"),"F:/office/test"));
    }
}
